﻿using System;
using System.Collections.Generic;

using System.Text;
using System.Diagnostics;
using System.Data;
using System.Data.Common;
using System.Security;
using System.Security.Permissions;

namespace DistributedCacheDataProvider
{
    public class DistributedCacheFactory : DbProviderFactory
    {
        public static DistributedCacheFactory Instance = null;

		static DistributedCacheFactory()
		{
			Instance = new DistributedCacheFactory();
		}

		public override DbCommand  CreateCommand()
		{
			return new DistributedCacheCommand();
		}
		public override DbConnection CreateConnection()
		{
			return new DistributedCacheConnection();
		}
		// Other providers (e.g. Odbc data provider) 
		// don't override what they don't support
		/*
		public override DbCommandBuilder CreateCommandBuilder()
		{
			throw new NotImplementedException();
		}
         */

		public override DbConnectionStringBuilder CreateConnectionStringBuilder()
		{
            return new DistributedCacheConnectionStringBuilder();
		}

		public override DbDataAdapter CreateDataAdapter()
		{
			return new DistributedCacheDataAdapter();
		}
		/*
		public override DbDataSourceEnumerator CreateDataSourceEnumerator()
		{
			throw new NotImplementedException();
		}
		public override DbParameter CreateParameter()
		{
			throw new NotImplementedException();
		}
		public override CodeAccessPermission CreatePermission(PermissionState s)
		{
			throw new NotImplementedException();
		} 
		*/
    }
}
